export default {
    router: {
        linkActiveClass: 'active',
        //自定义路由
        extendRoutes(routes, resolve) {
            //routes是数组 用splice方法清空默认的路由表   nuxtjs基于pages目录生成的默认路由表
            routes.splice(0)
            //向routes中添加自己的路由
            routes.push(...[
                {
                    path: '/',
                    component: resolve(__dirname, 'pages/layout/'),
                    children: [
                        {
                            path: '',//默认子路由 自己去找index了
                            name: 'home',
                            component: resolve(__dirname, 'pages/home/')
                        },
                        {
                            path: '/login',
                            name: 'login',
                            component: resolve(__dirname, 'pages/login/')
                        },
                        {
                            path: '/register',
                            name: 'register',
                            component: resolve(__dirname, 'pages/login/')
                        },
                        {
                            path: '/profile/:username',
                            name: 'profile',
                            component: resolve(__dirname, 'pages/profile/')
                        },
                        {
                            path: '/settings',
                            name: 'settings',
                            component: resolve(__dirname, 'pages/settings/')
                        },
                        {
                            path: '/editor',
                            name: 'editor',
                            component: resolve(__dirname, 'pages/editor/')
                        },
                        {
                            path: '/article',
                            name: 'article',
                            component: resolve(__dirname, 'pages/article/')
                        },
                    ]
                }
            ])
        }
    },
    server:{
        host:'0.0.0.0',
        port:3000
    },
    // 注册插件
    plugins:[
        // ~ 是从根路径出发
        '~/plugins/request.js',
        '~/plugins/dayjs.js'
        
    ]
}